<!doctype html>
<html>
<head>
<title> Users list </title>

<script type="text/javascript">
function validate()
{
	var limit=5;
	var val=document.getElementById("password").value;
	var x = document.getElementById("Email").value;
	var atpos=x.indexOf("@");
	var dotpos=x.lastIndexOf(".");
	if(val.length<5 || (atpos<1 || dotpos<atpos+2 || dotpos+2>=x.length))
	{
		alert("Email must be in a correct format. Password length can't be less than 5 characters and doesn't exceed 10");
	}
	else
	{
	
	    document.getElementById('submit').disabled=false;
	}
	
	
	
}
function validateForm()
{
<!--var x=document.forms["Form"]["email"].value;-->
var x = document.getElementById("Email").value;
var atpos=x.indexOf("@");
var dotpos=x.lastIndexOf(".");
if (atpos<1 || dotpos<atpos+2 || dotpos+2>=x.length)
  {
  alert("Not a valid e-mail address");
  return false;
  }
}
</script>
</head>

<body>

<!--<form name="form" action="" onsubmit="return validateForm();" method="post">
<!--<input type="submit" value="Validate" onclick="validateForm();">
<p>Email: <input type="text" name="email" size="10"></p>
<input type="submit" value="validate">
</form>-->

<form name = "myForm" action = "/signup/ " method = "POST">{% csrf_token %}

<p>Email: <input type="text" name=email id="Email" size="10">
<!--<input type="submit" value="Validate" onclick="validateForm();">-->
<p>First name: <input type="text" name=first_name size="10">
<p>Last name: <input type="text" name=last_name size="10">
<p>Password: <input type="text" name=password id="password" size="10">

<p>Confirm Password: <input type="text" name=confirmpassword size="10">
<p>Phone: <input type="text" name=phone size="10">
<br>
</br>
<input type="button" value="Validate" onclick="validate();" />
<button type="submit" id="submit" value="submit" disabled=true> Signup </button>

</a>
</form>
</p>







</body>
</html>
